home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr48 / tsbat146.zip / LASTBOOT.BAT < prev    next >
DOS Batch File  |  1992-09-19  |  1KB  |  46 lines

  1. echo off
  2. echo.
  3. echo ┌───────────────────────────────────────────────────┐
  4. echo │ LASTBOOT the date and time of the previous boot   │
  5. echo │ By Prof. Timo Salmi, ts@uwasa.fi, Sat 19-Sep-1992 │
  6. echo └───────────────────────────────────────────────────┘
  7.  
  8. if "%1"=="" goto _help
  9.  
  10. echo.| date | find "Current" > tmp$$$.bat
  11. echo set date_=%%3 %%4> current.bat
  12. call tmp$$$
  13.  
  14. echo.| time | find "Current" > tmp$$$.bat
  15. echo set time_=%%3,%%4> current.bat
  16. call tmp$$$
  17. if exist tmp$$$.bat del tmp$$$.bat
  18. if exist current.bat del current.bat
  19.  
  20. rem Record time and date of the current boot
  21. echo. > newboot.$$$
  22. echo          %date_% %time_%>> newboot.$$$
  23. echo          -------------------------->> newboot.$$$
  24. set date_=
  25. set time_=
  26.  
  27. rem Display the last boot and replace
  28. if exist oldboot.$$$ type oldboot.$$$
  29. if not exist oldboot.$$$ echo Boot date and time recorded
  30. copy newboot.$$$ oldboot.$$$ > nul
  31. del newboot.$$$ > nul
  32. goto _out
  33.  
  34. :_help
  35. echo.
  36. echo To get the information when your system was last booted put the
  37. echo following line in your autoexec.bat:
  38. echo.
  39. echo call LASTBOOT YourInitialsOrWhatever
  40. echo   or
  41. echo %comspec% /e:1024 /c LASTBOOT YourInitialsOrWhatever
  42. goto _out
  43.  
  44. :_out
  45. echo on
  46.